<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增光刻板损坏记录')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-record-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">光刻板号：</label>
                <div class="col-sm-8">
                    <input name="lightPlateNo" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="recordDate" id="laydate-demo-2" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">作业机台：</label>
                <div class="col-sm-8">
                    <input name="workingMachine" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">情况说明：</label>
                <div class="col-sm-8">
                    <input name="description" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">登记人：</label>
                <div class="col-sm-8">
                    <input name="recordPeople" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否通知：</label>
                <div class="col-sm-8">
                    <label class="radio-box">
                        否<input type="radio" value="0" id="ifConfirm1" name="ifConfirm" checked>
                    </label>
                    <label class="radio-box">
                        是<input type="radio" value="1" id="ifConfirm2" name="ifConfirm" >
                    </label>
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">确认标识：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <label class="toggle-switch switch-solid">-->
<!--                        <input type="checkbox" id="confirmFlag">-->
<!--                        <span></span>-->
<!--                    </label>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">确认人：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="confirmPeople" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "ph/platedamage";

        $(function(){
            layui.use('laydate', function (){
                var laydate = layui.laydate;
                laydate.render({
                    elem: '#laydate-demo-2',
                    type: 'date',
                    min: '2008-01-01'
                });
            });
        });

        $("#form-record-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                var data = $('#form-record-add').serialize();
                var status = $("input[id='confirmFlag']").is(':checked') == true ? 1 : 0;
                data = data + "&confirmFlag=" + status;
                $.operate.save(prefix + "/add", data);
            }
        }
    </script>
</body>
</html>